The coverage of paths is applicable if the system behaviour is described with the aid of decision points and paths.
Figure 1 shows an example.

Figure 1: Example of a specification of the system behaviour in terms of decision points and paths.
Such a chart of decision points and paths shows, in a structured way, how the process runs from start to end and what
the various possibilities in the course of the process are: At each decision point, the process can go various ways,
indicated by the various paths that continue from the particular decision point. The conditions under which it takes one
path or another are described in the decision points themselves.
The aim of the coverage type described here is to cover the variations in the process run that are possible according to
the chart. The test situations are described in this case by indicating which paths in the chart should be followed
consecutively.
Keep in mind that such charts with decision points and paths do not necessarily have to be about the functionality of the
system. Security processes or work procedures in business processes can also be described with such charts, which makes the
basic technique described here applicable to other test types.
Neither is the abstraction level relevant: it is applicable at both detailed level (algorithm code) and at overall system
level, as long as the information on the required system behaviour is provided in the structured form of decision points
and paths.
Levels of coverage: the test depth level
In the coverage of paths, various levels are possible. The more thorough the level, the greater the probability of
finding defects. This is explained below. The most elementary form of path coverage only provides the guarantee that each
path has been travelled once. The test situations consist in this case of every individual path. In our example (Figure 1),
these are the test situations: 1 ; 2; 3; 4; 5; 6; 7;
A test case is a completed whole that goes through the process run from “Start” to “End”. The above-mentioned test
situations can, for example, be covered with the following 2 logical test cases:
TC1 = 1 2 5 3 4 6
TC2 = 1 3 4 7
This finds all the faults that will always occur in a particular path. However, it is not for certain that faults that only
occur with a specific combination of process steps will be found in this way. In our example, therefore, a particular fault
may be present, which only occurs if path 2 is carried out immediately after path 5 . That is equal to a “5-2” test
situation and is not covered by the above two test cases. This type of fault is only found if the variations in the process
run are covered in a more thorough way. Usually this means that additional, or more complex, test cases are necessary. And
suppose that a fault exists that only occurs when “path 2 is carried out immediately after path 5, which in turn is carried
out immediately after path 3”. That is equal to a “3-5-2” test situation. In order to find this type of fault, testing has
to be more thorough.
The depth of coverage is reflected in the concept of test depth level: "Test depth level N = the certainty that all the
combinations of N consecutive paths are covered."
The test depth level in principle runs from 1 to unlimited. The higher the test depth level, the greater the certainty
that even faults that occur in complex compositions of process steps will be found. A higher test depth level implies a
lower test depth level. In other words, a higher test depth level will at any rate find all the faults that can be
found with a lower test depth level, plus possible additional faults.
Deriving the test situations for test depth level 1 is easy. The basic technique for obtaining test depth level 2 is
described below. Subsequently, it is explained how higher test depth levels can be derived simply from test depth level
2.
Technique for obtaining test depth level 2
Irrespective of the test depth level, the starting point for this technique requires a test basis that describes the
system behaviour in terms of decision points and paths. The following steps are then carried out:
-
Decision points & paths - Nominate the decision points in the process scheme (A, B, etc.) and number
the paths, as in Figure 1. Sum up, per decision point, the:
-
Incoming paths (“IN”)
-
Outgoing paths (“OUT”)
-
Path combinations - Working out all the combinations of “IN” and “OUT” at each decision point. With a
number of incoming P paths and outgoing Q paths, this leads to P times Q path combinations.
-
Logical test cases - Creation of logical test cases, until all the path combinations are covered. Each
logical test case begins at “Start” and finishes at “End”, running through various path combinations.
The first 2 steps lead to the test situations in the test design. They are all the variations (in this case, path
combinations) that have to be tested in order to reach test depth level 2.
Step 3 leads to a set of logical test cases that are guaranteed to cover all the test situations. The tester is free to
create a set of test cases that comply with this. If necessary, it can be shown with the aid of a cross-reference
matrix that all the test situations are covered with the chosen set of test cases. In principle, there are two ways of
arriving at a covering set of test cases:
-
Working from the process chart, define a test case by running through the process in a particular way from “Start”
to “End”. The tester is in principle free to choose the exact way of going through the process. Cross out of the
list of path combinations every combination that occurs in this test case. Repeat this process until the list of
path combinations is completely crossed out.
-
Working from the list of path combinations, start with a path combination that begins at “Start” (e.g. “1-3”). Seek
a subsequent path combination that starts with the path with which the previous one ends (e.g. a “3-5”) – like
setting down domino tiles, in fact. Continue seeking a subsequent path combination until “End” has been reached.
Obviously, previously unused path combinations should be used as much as possible.
The steps are now explained using the example in Figure 1: Breakdown of test depth level 2 for the scheme from Figure
1.
1. Decision points & paths:
A:
|
IN:
|
1, 5
|
|
OUT:
|
2, 3
|
B:
|
IN:
|
2, 3
|
|
OUT:
|
4, 5
|
C:
|
IN:
|
4
|
|
OUT:
|
6, 7
|
2. Path combinations:
A:
|
1-2; 1-3; 5-2; 5-3
|
B:
|
2-4; 2-5; 3-4; 3-5
|
C:
|
4-6; 4-7
|
3. Logical test cases:
TC1 = 1-2-5-3-4-6 (Cross out the path combinations covered here)
TC2 = 1-3-5-2-4-7 (Simply follows from the remaining
path combinations.)
Cross-reference matrix (optional)
|
TC1
|
TC2
|
1-2
|
X
|
|
1-3
|
|
X
|
5-2
|
|
X
|
5-3
|
X
|
|
2-4
|
|
X
|
2-5
|
X
|
|
3-4
|
X
|
|
3-5
|
|
X
|
4-6
|
X
|
|
4-7
|
|
X
|
Deriving test situations for higher test depth levels
For higher test depth levels, the following simple mechanism is used:
-
Use the list of path combinations of the preceding test depth level as a basis
-
Extend each path combination by every possible subsequent step in the course of the process. So, suppose that after
path P there are three possible subsequent steps, let us say Q, R and S. Then every path combination that ends at P
is extended to three new ‘higher’ path combinations: ..PQ and ..PR and ..PS.
It may be formulated as: Test depth level (N+1) = Test depth level N + “1 step further in the course of the
process”
This is broken down in the example below:
Test depth level 3 from the chart in Figure
1. It is simple to deduce the following
from the scheme:
Path 1 is the starting point for every test
case
Paths 2 and 3 are followed by paths 4 and 5
Path 5 is followed by paths 2 and 3
Path 4 is followed by paths 6 and 7
Paths 6 and 7 are end paths and have no sequel.
This can directly extend the path combinations of test
depth level 2 to test depth level 3:
Path combinations from test depth
level 2
|
Extended to test depth level 3
|
A: 1-2
1-3
5-2
5-3
|
1-2-4; 1-2-5
1-3-4; 1-3-5
5-2-4; 5-2-5
5-3-4; 5-3-5
|
B: 2-4
2-5
3-4
3-5
|
2-4-6; 2-4-7
2-5-2; 2-5-3
3-4-6; 3-4-7
3-5-2; 3-5-3
|
C: 4-6
4-7
|
No extension and already
covered.
No extension and already
covered.
|
In the same way, the test situations of test depth level 3 can be extended to test depth level 4.
|